home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 1 / 001.d81 / decision maker (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  144 lines

  1. 100 print"[147]":gosub10000
  2. 200 rem  a decision maker
  3. 300 :
  4. 400 dimf$(10),l$(10),f(10),m(10,10),v(10),z(10):print
  5. 600 print"[147]":print
  6. 700 printtab(3)"*** computerized decision-maker ***"
  7. 800 print:print
  8. 900 y$="y":print"   i can help you make decisions by"
  9. 1000 print"choosing the best possibility for you"
  10. 1100 print"out of several alternatives."
  11. 1200 print
  12. 1300 print"all i need to do is organize informationyou already have."
  13. 1400 print
  14. 1405 print"  which of these best describes the typeof decision you have to make?
  15. 1410 [153]
  16. 1500 [153]"1-choose an item from several             alternatives."
  17. 1600 [153]"2-choose a course of action from several  alternatives."
  18. 1700 [153]:[153]"which type(1 or 2) choice do you have to make":[133]c
  19. 1800 [139]c[179]1[176]c[177]2[167]1700
  20. 1900 [153]:[139]c[178]1[167][153]"   what type of item is it that you "
  21. 2000 [139]c[178]1[167][153]"need to decide upon?":[133]s$
  22. 2100 [139]c[178]2[167]s$[178]"course of action"
  23. 2200 [153]:[153]"i will now need a list of each ":[153]s$;
  24. 2300 [153]" that you are ":[153]"considering. please input";
  25. 2400 [153]" them one":[153]"at a time. the order is"
  26. 2500 [153]"of no particular importance.":[153]
  27. 2608 [133]"first, how many are there altogether";l0
  28. 2700 [139]l0[177][178]2[175]l0[179][178]10[167]2900
  29. 2800 [141]9700:[137]2608
  30. 2900 [153]:[129]i[178]1[164]l0:[153]:[153]"number ";i;", please."
  31. 3000 [133]l$(i):[130]i:[153]
  32. 3100 [153]"o.k., this is the list under considera- tion":[153]
  33. 3200 [129]i[178]1[164]l0:[153]i;[163]5);l$(i):[130]i:[153]:[141]9800
  34. 3300 [139]b$[179][177]y$[167]2200
  35. 3400 [153]:[153]"   now, how many different factors are"
  36. 3500 [153]"important to you in choosing a ";s$;"?":[133]f0
  37. 3600 [139]f0[177]1[175]f0[179]10[167]3800
  38. 3700 [141]9700:[137]3400
  39. 3800 [153]:[153]"  i need a list of each of these factors "
  40. 3900 [129]i[178]1[164]f0:[153]:[153]"factor number ";i:[133]f$(i):[130]
  41. 4000 [153]"load"
  42. 4100 [153]:[153]"   now look at the following list of"
  43. 4200 [153]"factors you have provided and decide"
  44. 4300 [153]"which is the most important to you:"
  45. 4400 [153]:[129]i[178]1[164]f0:[153]i;[163]5);f$(i):[130]
  46. 4500 [153]:[153]"which factor(by number)is most important"
  47. 4600 [153]"(input 0 if you wish to change the list) ":[133]f2
  48. 4700 [139]f2[178]0[167]3400
  49. 4800 [139]f2[179]1[176]f2[177]f0[167]4500
  50. 4900 [153]:[153]"   o.k., suppose we have a scale of"
  51. 5000 [153]"importance that ranges from 0 to 10."
  52. 5100 [153]"let's say ";f$(f2);" has a value of 10,"
  53. 5200 [153]"since it is at the top of the scale/"
  54. 5300 [153]"on this scale, what value would"
  55. 5400 [153]"each of the other factors have?"
  56. 5500 [153]"   (decimal numbers are o.k.)":[153]:[129]i[178]1[164]f0
  57. 5600 [139]i[178]f2[167]5900
  58. 5700 [153]f$(i):[133]f(i):[139]f(i)[177]0[175]f(i)[179][178]10[167]5900
  59. 5800 [153]"  your input is no good. try again!":[137]5700
  60. 5900 [130]
  61. 5905 f(f2)[178]10
  62. 5910 c[178]0
  63. 5915 [129]i[178]1[164]f0
  64. 5920 c[178]c[170]f(i)
  65. 5925 [130]
  66. 5930 [129]i[178]1[164]f0
  67. 6000 f(i)[178]f(i)[173]c:[130]:[153]:[153]"now conider how each ";s$
  68. 6100 [153]"rates with respect to each of the"
  69. 6200 [153]"factors. we will consider each factor"
  70. 6300 [153]"separately and then rate each"
  71. 6400 [153]s$;" in terms of that factor"
  72. 6500 [153]"only.":[153]
  73. 6600 [153]"let's consider ";l$(1);" to have a"
  74. 6700 [153]"value of 10 on each scale."
  75. 6800 [153]"then every other ";s$
  76. 6900 [153]"will be given a number higher or lower"
  77. 7000 [153]"than 10 according to how much better"
  78. 7100 [153]"or worse than ";l$(1);" you think it is.":[129]i[178]1[164]f0:[153]
  79. 7200 [153]
  80. 7300 [153]"considering ";f$(i);" only, and"
  81. 7400 [153]"assuming ";l$(1);" has a value of 10,"
  82. 7500 [153]"what value would you give to each of thefollowing;"
  83. 7600 [153]:[129]j[178]2[164]l0
  84. 7700 [153]l$(j):[133]m(j,i):[139]m(j,i)[177][178]0[167]7900
  85. 7800 [153]"  c'mon, no negative numbers! try again.":[137]7700
  86. 7900 [130]j
  87. 7905 [153]
  88. 7910 m(1,i)[178]10
  89. 7915 [130]i
  90. 7920 [129]i[178]1[164]f0
  91. 7925 c[178]0
  92. 7930 [129]j[178]1[164]l0
  93. 8000 c[178]c[170]m(j,i)
  94. 8005 [130]j
  95. 8010 [129]j[178]1[164]l0
  96. 8015 m(j,i)[178]m(j,i)[173]c
  97. 8020 [130]j
  98. 8025 [130]i
  99. 8100 [129]j[178]1[164]l0:v(j)[178]0:[129]i[178]1[164]f0:v(j)[178]v(j)[170]m(j,i)[172]f(i)
  100. 8200 [130]i
  101. 8205 [130]j
  102. 8210 [129]i[178]1[164]10
  103. 8215 z(i)[178]i
  104. 8220 [130]i
  105. 8225 c[178]l0[171]1
  106. 8230 [129]j[178]1[164]l0
  107. 8300 [129]i[178]1[164]c:n1[178]z(i):n2[178]z(i[170]1):[139]v(n1)[177]v(n2)[167]8500
  108. 8400 z(i[170]1)[178]n1:z(i)[178]n2
  109. 8500 [130]i:[130]j:c1[178]z(1):c2[178]z(2):c[178]100[173]v(c1):[129]j[178]1[164]l0
  110. 8600 v(j)[178]c[172]v(j):[130]:[153]:[153]:d[178]v(c1)[171]v(c2)
  111. 8700 [153]"  well, you best choice seems to be "
  112. 8800 [153]l$(c1);", ";
  113. 8900 [139]d[179]10[167][153]"but it's very close."
  114. 9000 [139]d[179]20[175]d[177][178]10[167][153]"by a fair margin."
  115. 9100 [139]d[177][178]20[167][153]"by a good-sized margin."
  116. 9200 [153]:[153]"here's the final list with ";l$(c1)
  117. 9300 [153]"given a value of 100 and the others set accordingly:"
  118. 9400 [153]:[153]:[153]"rating ",s$:[129]j[178]1[164]l0:c[178]z(j)
  119. 9500 [153]
  120. 9600 [153][181](v(c)),l$(c):[130]
  121. 9605 [161]k$:[139] k$[178]""[167]9605
  122. 9610 [138]
  123. 9700 [153]"   the number must be between 2 and 10":[142]
  124. 9800 [133]"   is this correct (yes or no)?";a$
  125. 9900 b$[178][200](a$,1):[142]
  126. 10000 [153]"load";:[153]"decision maker"
  127. 10100 [153]:[153]
  128. 10200 [153]
  129. 10300 [153]:[153]:[153]"having a hard time making a decision?
  130. 10400 print"let your commodore help you"
  131. 10500 print"":print"  press 'f1' to end"
  132. 10600 print"":print"< press the space bar to continue.>"
  133. 10700 poke190,0:poke198,1:geta$
  134. 10800 ifa$="[133]"then11005
  135. 10810 ifa$=" "thenprint"[147]":return
  136. 10820 goto10700
  137. 11005 print"[147]"
  138. 11010 print""
  139. 11015 print"";
  140. 11020 print"* * * the  end * * *"
  141. 11021 print"load"chr$(34)"payload"chr$(34)",8":print"run"
  142. 11022 poke631,13:poke632,13:poke198,2
  143. 11025 end
  144.